<?php
header("Content-type: text/html; charset=utf-8");
$link = mysqli_connect('localhost','root','','my_database');
if (!$link){
    exit ("数据库链接错误".mysqli_connect_error());
}
if (!mysqli_set_charset($link,'utf8')) {
    exit("数据库字符集错误".mysqli_error($link));
}
 //echo "链接成功！";
?>